# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>

pkgname=libxcursor
pkgver=1.2.0
pkgrel=2
pkgdesc="X cursor management library"
arch=(x86_64)
url="https://xorg.freedesktop.org/"
license=('custom')
depends=('libxfixes' 'libxrender')
optdepends=('gnome-themes-standard: fallback icon theme')
makedepends=('xorg-util-macros')
backup=(usr/share/icons/default/index.theme)
source=(${url}/releases/individual/lib/libXcursor-${pkgver}.tar.bz2{,.sig}
        index.theme)
sha512sums=('2b12d0fd17e311ce269dbba58588698885815eb07aa44d48525ed5cd9e5f379bb90138a792a191e2f74888ab10b3ca9a4f507f21de0984ed79748973ab927a03'
            'SKIP'
            '489a07b5c9c50b9ddbd10093c79a07d34f2f1c9b4f053ecd68a9f300e201f7b92890b92f0bb4963dfeaa1b158f43149d615b07d1e70523de41565eff7dd5fccb')
validpgpkeys=('C41C985FDCF1E5364576638B687393EE37D128F8') # "Matthieu Herrb <matthieu.herrb@laas.fr>"
validpgpkeys+=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # "Alan Coopersmith <alan.coopersmith@oracle.com>"

build() {
  cd libXcursor-${pkgver}
  ./configure --prefix=/usr --sysconfdir=/etc --disable-static
  make
}

package() {
  cd libXcursor-${pkgver}
  make DESTDIR="${pkgdir}" install

  install -m755 -d "${pkgdir}/usr/share/icons/default"
  install -m644 "$srcdir"/index.theme "${pkgdir}/usr/share/icons/default/"

  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
